package top.xchch.creational.prototype.version03;

public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        DeepPrototype dp = new DeepPrototype();
        dp.setTarget(new DeepCloneableTarget());

        System.out.println("-------- clone 方法完成深拷贝 --------");
        DeepPrototype clone = dp.clone();
        System.out.println(dp.getTarget() == clone.getTarget()); // false

        System.out.println("-------- clone 方法完成深拷贝 --------");
        DeepPrototype clone02 = dp.deepClone();

        System.out.println(dp.getTarget() == clone02.getTarget()); // false
    }
}
